%dropdown-li-a-padding {
    padding: 3px $o-dropdown-hpadding;
}

.ui-autocomplete { // Copy style of bootstrap dropdown
    background-image: none;
    background-color: $dropdown-bg;
    border: $dropdown-border-width solid $dropdown-border-color;
    font-size: $font-size-base;
    padding: 5px 0px;
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.176);

    .ui-menu-item {
        padding: 0;
        > a {
            display: block;
            color: $dropdown-link-color;

            @extend %dropdown-li-a-padding;

            &.ui-state-active {
                border: none;
                font-weight: normal;
                margin: 0;
            }
        }
        &.o_m2o_dropdown_option, &.o_m2o_start_typing {
            text-indent: 20px
        }
        &.o_m2o_start_typing {
            font-style: italic;
            cursor: default;
            a.ui-menu-item-wrapper, a.ui-state-active, a.ui-state-active:hover {
                background: none;
            }
        }
    }
}

.dropdown-menu {
    box-shadow: 0 6px 12px -4px rgba(black, 0.25);

    .o_inline_dropdown {
        position: relative;

        & > .dropdown-menu {
            top: 0;
            left: 100%;
        }
        &:hover .dropdown-menu {
            display: block;
        }
    }
}

@mixin dropdown-menu-mixin {
    .show .dropdown-menu {
        > * {
            position: relative; // to allow absolute positionning inside the items
        }

        .dropdown-item {
            &:focus, &:active, &:focus:active {
                outline: none;
            }

            @extend %dropdown-li-a-padding;
        }

        .dropdown-header {
            @extend %dropdown-li-a-padding;
            color: $o-main-text-color;

            @include media-breakpoint-down(sm) {
                color: white;
                text-decoration: underline;
            }
        }
    }
}

@include dropdown-menu-mixin;
.navbar-nav {
    @include dropdown-menu-mixin;
}

.o_rtl {
    .dropdown-menu {
        left: auto;
    }
}
